package top.eggcode.system.modules.log.service;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.eggcode.common.base.BaseMarkServiceImpl;
import top.eggcode.common.model.ListPage;
import top.eggcode.plugins.query.CriteriaBuilder;
import top.eggcode.system.modules.log.model.StorageLogEntity;
import top.eggcode.system.modules.log.model.StorageLogQuery;
import top.eggcode.system.modules.log.store.StorageLogRepository;

/**
 * Title:
 * Description: TODO
 * Date: 2021/5/28 10:11
 *
 * @author JiaQi Ding
 * @version 1.0
 */
@Slf4j
@Transactional(rollbackFor = Exception.class)
@AllArgsConstructor
@Service
public class StorageLogServiceImpl extends BaseMarkServiceImpl<StorageLogEntity> {

    private final StorageLogRepository selfRepository;

    private final CriteriaBuilder builder;


    public ListPage<StorageLogEntity> page(StorageLogQuery query) {

        return builder.createQuery(StorageLogEntity.class)
                .select()
                .fromEntity("root")
                .fetchPage(query);
    }
}
